<script setup>
import blogPageOne from '@/components/blog-components/blog-PageOne.vue'

const router = useRouter()

</script>
<template>
    <div class="main">
        <blogPageOne :pageWidth="1200">
            <h2 class="project-Title">我制作的项目</h2>
            <br>
            <hr>
            <div class="projects">
                <div class="project" @click="router.push('/project1')">
                    <div class="icon"></div>
                    <div class="info">
                        <h3>不同的页面</h3>
                        <p>包含表单和主页</p>
                    </div>
                </div>
                <div class="project">
                    <div class="icon"></div>
                    <div class="info">
                        <h3>自定义音频可视化</h3>
                        <p>使用canvas进行音频可视化绘制</p>
                    </div>
                </div>
            </div>
        </blogPageOne>
    </div>
</template>

<style lang="scss" scoped>
@use '@/assets/variables.scss' as *;

.main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 10px;

    .project-Title {
        font-size: 30px;
    }

    .projects {
        display: flex;
        flex-wrap: wrap;

        .project {
            width: calc(50% - 2rem);
            margin: 16px;
            padding: 16px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, .1);
            transition: background-color 0.3s ease;
            display: flex;

            @media (max-width: 820px) {
                & {
                    width: calc(100% - 2rem);
                }
            }


            .icon {
                height: 100%;
                aspect-ratio: 1/1;
                /* 宽高比1:1 */
                border-radius: 6px;
                background: #000;
            }

            .info {
                margin-left: 20px;
                transition: color 0.3s ease;

                h3 {
                    font-size: 20px;
                }

                p {
                    font-size: 16px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space:nowrap;
                }
            }

            &:hover {
                background-color: pink;

                .info {
                    color: #fff;
                }
            }
        }
    }
}
</style>